package com.szrt.java.day20161226.demo12;

public class ArrayUtil {
	
	
	public static void main(String[] args) {
		int[] ages = new int[3];
		
		ages[0]=23;
		ages[1]=18;
		ages[2]=16;
		
		printArray(ages);
	}
	
	public static void printArray(int[] arrays){
		int len = arrays.length;
		//System.out.println("len="+len);
		for(int index = 0; index<=len-1; index++){
			int value = arrays[index];
			if(index == len -1){
				System.out.print(value);
				break;
			}
			System.out.print(value + ", ");
		}
		System.out.println();
	}

}
